import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
//导入全局样式表
import './assets/css/global.css'
//导入字体图片
import './assets/fonts/iconfont.css'
//导入全局element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
//导入弹窗提示组件
import { Message } from 'element-ui'
//导入axios依赖
import axios from 'axios'
//导入入qs依赖
import qs from 'qs'


//配置请求的根路径
// axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
axios.defaults.baseURL = 'http://localhost:9527/'
//axios请求拦截
axios.interceptors.request.use(config => {
	// 为请求头对象，添加Token验证的Authorization字段
	config.headers.Authorization = window.sessionStorage.getItem('token')
	return config
})
//全局引入axios
Vue.prototype.$http = axios
//全局引入qs
Vue.prototype.$qs = qs
//使用ElementUI
Vue.use(ElementUI)
//全局引入弹窗提示组件
Vue.prototype.$message = Message

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
